/*
 * myrfm12conf.c
 *
 *  Created on: 24.03.2010
 *      Author: daniel
 */
#include "myrfm12.h"

/*! \file myrfm12conf.c
 *  This file has to be adapted to configure the myrfm12 library.  */

#if (MYRFM12_CONF_SPI == MYRFM12_CONF_SPI_HW)
	/*! setup for HW spi */
	void myrfm12_port_init_hw_spi(void)
	{
		MYRFM12_CONF_PORT=(1<<MYRFM12_CONF_CS);
		MYRFM12_CONF_DDR&=~(1<<MYRFM12_CONF_SDO);
		MYRFM12_CONF_DDR|=(1<<MYRFM12_CONF_SDI)|(1<<MYRFM12_CONF_SCK)|(1<<MYRFM12_CONF_CS);

		SPCR=(1<<SPE)|(1<<MSTR);
	}
#endif

#if (MYRFM12_CONF_SPI == MYRFM12_CONF_SPI_SW)
	/*! setup for SW spi */
	void myrfm12_port_init_sw_spi(void)
	{
		MYRFM12_CONF_DDR=(1<<MYRFM12_CONF_SDI)|(1<<MYRFM12_CONF_SCK)|(1<<MYRFM12_CONF_CS);
		MYRFM12_CONF_PORT=(1<<MYRFM12_CONF_CS);
	}
#endif

#if(MYRFM12_CONF_DEBUG == MYRFM12_CONF_DEBUG_YES)
	/*! debug function, sending command over uart */
	void myrfm12_debug(uint16_t cmd)
	{
		char temp[4];
		itoa(cmd,temp,16);
		uart_puts_P("Wert:\n");
		uart_puts(temp);
		uart_puts_P("\n");

		
	}

#endif


